package com.zsck.zsgy.ui.main.fragment.simplecircle.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.zsck.zsgy.R
import com.zsck.zsgy.databinding.ItemSimpleCircleMultiBinding
import com.zsck.zsgy.ui.main.bean.SimpleCircleActivityBean
import com.zsck.zsgy.util.GlideUtils

class SimpleActivityAdapter :
    BaseQuickAdapter<SimpleCircleActivityBean.RowsBean, BaseDataBindingHolder<ItemSimpleCircleMultiBinding>>(
        R.layout.item_simple_circle_multi
    ) {


    override fun convert(
        holder: BaseDataBindingHolder<ItemSimpleCircleMultiBinding>,
        item: SimpleCircleActivityBean.RowsBean
    ) {
        if (holder.dataBinding != null) {
            holder.dataBinding!!.activity = item
            holder.dataBinding!!.tvSignState.text =
                "已报" + item.joinNum + "人 / 限报" + item.userlimit
            holder.dataBinding!!.tvTime.text=item.startTime+"至"+item.endTime
            holder.dataBinding!!.tvNumber.text = ((item.userlimit - item.joinNum).toString())
            if (item.getFiles() != null && item.getFiles().get(0).getFileId() != null) {
                GlideUtils.disPlayFromOSSWithConner(
                    item.getFiles().get(0).getFileId(),
                    holder.dataBinding!!.ivIcon,
                    context,
                    13
                )
            }

        }
    }


}